<template>
  <div class="threeStep">
    <header>
      <span>任务列表</span>
      <img class="close" src="/images/button/close.png" alt />
    </header>
    <el-row>
      <img class="line" src="/images/report/litline.png" alt />
    </el-row>
    <el-table :data="expertGroup" border>
      <el-table-column type="index" width="50" label="序号"></el-table-column>
      <el-table-column prop="expertName" label="姓名" width="180">
        <template slot-scope="scope">
          <label for>
            <input
              type="text"
              placeholder="请输入"
              @change="inputText"
              class="tableinput"
              v-model="scope.row.expertName"
            />
          </label>
        </template>
      </el-table-column>
      <el-table-column prop="role" label="角色" width="150">
        <template slot-scope="scope">
          <el-select v-model="scope.row.role" placeholder="请选择" @change="inputText">
            <el-option
              v-for="item in options"
              :key="item.value"
              :label="item.label"
              :value="item.value"
            ></el-option>
          </el-select>
        </template>
      </el-table-column>
      <el-table-column prop="job" label="职称">
        <template slot-scope="scope">
          <label for>
            <input
              type="text"
              placeholder="请输入"
              @change="inputText"
              class="tableinput"
              v-model="scope.row.job"
            />
          </label>
        </template>
      </el-table-column>
      <el-table-column prop="department" label="单位">
        <template slot-scope="scope">
          <label for>
            <input
              type="text"
              placeholder="请输入"
              @change="inputText"
              class="tableinput"
              v-model="scope.row.department"
            />
          </label>
        </template>
      </el-table-column>
      <el-table-column label="操作" width="100">
        <template slot-scope="scope">
          <el-button
            @click.native.prevent="deleteRow(scope.$index, expertGroup)"
            type="text"
            size="small"
          >删除</el-button>
        </template>
      </el-table-column>
    </el-table>
	  <div class="btn_style_class add_people_btn_position" @click="addRow"><span>添加人员</span></div>
<!--    <el-button style="margin-top: 12px;"@click="addRow" >添加人员</el-button>-->
  </div>
</template>

<script>
export default {
  data() {
    return {
      expertGroup: [],
      options: [
        {
          label: "组长",
          value:1
        },
        {
          label: "组员",
          value:0
        }
      ],
	iniValue:0
    };
  },
  methods: {
    inputText() {
      console.log(this.expertGroup);
    },
    addRow() {
      let obj = { expertName: "", role: 0, job: "", department: "" };
      this.expertGroup.push(obj);
    },
    deleteRow(index, rows) {
      rows.splice(index, 1);
    }
  }
};
</script>

<style lang="scss">
.threeStep {
  height: 100%;
  header {
    width: 100%;
    font-size: 0.2rem;
    font-weight: 400;
    color: #2fd5ff;
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
    .arrow {
      margin-right: 1.06rem;
    }
    .close {
      cursor: pointer;
      padding: 5px 7px;
    }
  }
  .line {
    width: 100%;
  }
  .el-table {
    height: 70%;
    .tableinput {
      font-size: 14px;
      border: none;
      background: none;
      color: #fff;
      width: 85%;
      text-align: center;
    }
  }
  .el-table__body-wrapper {
    overflow: scroll;
    height: 91%;
  }
  .el-table__body tr.current-row > td {
    background-color: #b67d10 !important;
  }
  .el-select {
    .el-input__inner {
      background: rgba(16, 34, 67, 0.5);
      border-radius: 2px;
      border: 1px solid rgba(96, 118, 173, 0.35);
      color: #fff;
    }
  }
}
.el-select-dropdown {
  border: none;
  border-radius: 0;
  background: linear-gradient(
    90deg,
    rgba(19, 135, 178, 0.9) 0%,
    rgba(29, 74, 161, 0.9) 100%
  );
  .el-select-dropdown__item {
    color: #fff;
    padding: 0 10px;
    margin: 3px 4px;
    // background-color: #102243;
    background: #0b152c;
  }
  .el-select-dropdown__item.hover,
  .el-select-dropdown__item:hover {
    background-color: #b67d10;
  }
  .el-select-dropdown__list {
    padding: 0 0 5px 0;
  }
	.add_people_btn_position{
		right: 24px;
	}
}
</style>
